﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Session.Add("UserID", 1);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Cstudy.MODEL.users user = new Cstudy.MODEL.users();
        user.Pwd = TextBox2.Text;
        user.UserName = TextBox1.Text;
        user.Email = TextBox3.Text;
        if (new Cstudy.BLL.Users().AddUser(user))
        {

        }
        else
        {

        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Cstudy.MODEL.artcles artcle = new Cstudy.MODEL.artcles();
        artcle.Title = TextBox4.Text;
        artcle.Content = TextBox5.Text;
        artcle.Summary = TextBox6.Text;
        artcle.AuthorID = (int)Session["UserName"];
        if (new Cstudy.BLL.Artcles().AddArtcle(artcle))
        {

        }
        else
        {
            
        }
    }
}